#pragma once
#include <iostream>
#include "Component\Renderer\Base\RendererControl.h"
#include "Core\Item.h"
#include "Includes\SDefine.h"
#include "Core\ResourceControl.h"

namespace SakuraAge {
class SquareRenderer : public Component,
                       public RendererControl,
                       public RefBase<SquareRenderer> {
  friend class RefBase<SquareRenderer>;
  friend class Component;
  friend class RendererControl;

 private:
  SquareRenderer();
  virtual ~SquareRenderer();
  static std::string vertShader;
  static std::string fragShader;
  static bool isInitialized;

 public:
  virtual void OnRenderer();
  virtual void Awake();
  virtual void Update(){};

  void Fresh();

  float* vertices;
};
SquareRenderer::SquareRenderer() {}
SquareRenderer::~SquareRenderer() {}
std::string SquareRenderer::vertShader;
std::string SquareRenderer::fragShader;
bool SquareRenderer::isInitialized;

void SquareRenderer::OnRenderer() {
  // std::cout << "GUN";
}

void SakuraAge::SquareRenderer::Awake() {
  DebugLog("[SquareRenderer] Initializing Square Renderer......\n");
  if (!isInitialized) {
    // Cardinal::LoadString();
    DebugLog("[SquareRenderer] Loading shaders......\n");
    vertShader = ResourceControl::LoadStringFromResource("Shaders/Square.vert");
    fragShader = ResourceControl::LoadStringFromResource("Shaders/Square.frag");
  }
  vertices = new float[12];

  DebugLog("[SquareRenderer] Initialized.\n");
}

void SquareRenderer::Fresh() {}
}  // namespace SakuraAge
